package main

import (
	"fmt"
	"log"

	"github.com/sbinet/go-python"
)

func init() {
	err := python.Initialize()
	if err != nil {
		panic(err.Error())
	}
}

func main() {
	m := python.PyImport_ImportModule("httptest")
	if m == nil {
		log.Fatalf("could not import 'http'\n")
	}
	http := m.GetAttrString("fetch_get_state")
	url := python.PyString_FromString("http://www.baidu.com")
	out := http.CallFunctionObjArgs("O",url)
	str := python.PyString_AsString(out)
	fmt.Println(str)
}
